package cn.lliiooll.ippzonetoolbox.ui.notifications;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import cn.lliiooll.ippzonetoolbox.R;
import com.alibaba.android.arouter.launcher.ARouter;

public class NotificationsFragment extends Fragment {

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_notifications, container, false);
        final TextView textViewQQ = root.findViewById(R.id.text_notifications_qq);
        final TextView textViewGroup = root.findViewById(R.id.text_notifications_group);
        textViewQQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // https://wpa.qq.com/msgrd?v=3&uin=3483706632
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                Uri content_url = Uri.parse("https://wpa.qq.com/msgrd?v=3&uin=3483706632");
                intent.setData(content_url);
                startActivity(intent);
            }
        });
        textViewGroup.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //点击链接加入群聊【段友大家庭】：https://jq.qq.com/?_wv=1027&k=tqADaFrp
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                Uri content_url = Uri.parse("https://jq.qq.com/?_wv=1027&k=tqADaFrp");
                intent.setData(content_url);
                startActivity(intent);
            }
        });
        return root;
    }
}
